<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>课文设置管理</title>
	<meta name="decorator" content="ani"/>
	<style>
		.select-disabled {
			pointer-events: none;
			background-color: #eeeeee;
		}
	</style>
	<script type="text/javascript">

		$(document).ready(function() {
			$("#inputForm").find("select").each(function () {
				if ($(this).attr("data-value") != '' && $(this).attr("data-value") != undefined) {
					$(this).val($(this).attr("data-value"));
				}
			});

		});
		function save() {
            var isValidate = jp.validateForm('#inputForm');//校验表单
            if(!isValidate){
                return false;
			}else{
                jp.loading();
                jp.post("${ctx}/basedata/kewenshez/kewenshez/save",$('#inputForm').serialize(),function(data){
                    if(data.success){
                        jp.getParent().refresh();
                        var dialogIndex = parent.layer.getFrameIndex(window.name); // 获取窗口索引
                        parent.layer.close(dialogIndex);
                        jp.success(data.msg)

                    }else{
                        jp.error(data.msg);
                    }
                })
			}

        }
	</script>
</head>
<body class="bg-white">
	<form:form id="inputForm" modelAttribute="kewenshez" class="form-horizontal">
		<form:hidden path="id"/>
		<form:hidden path="classid"/>
		<form:hidden path="company.id"/>
			<fieldset class="well-new">
				<div class="form-group">
					<label class="col-sm-2 col-md-1 control-label">课文设置：</label>
					<div class="col-sm-10 col-md-2">
						<form:input path="name" htmlEscape="false"   autocomplete="off"  class="form-control "/>
					</div>
					<label class="col-sm-2 col-md-1 control-label">课文主题：</label>
					<div class="col-sm-10 col-md-2">
						<form:input path="kwzt" htmlEscape="false"   autocomplete="off"  class="form-control "/>
					</div>
					<label class="col-sm-2 col-md-1 control-label">单元：</label>
					<div class="col-sm-10 col-md-2">
						<select id="dy" name="dy.id" class="form-control m-b required" data-value="${kewenshez.dy.id}">
							<option value=""></option>
							<c:forEach items="${fns:getSelectList('','','bt_base','name','classid|单元设置' )}" var="dict">
								<option value="${dict.id}">${dict.name}</option>
							</c:forEach>
						</select>
					</div>
					<label class="col-sm-2 col-md-1 control-label">学科：</label>
					<div class="col-sm-10 col-md-2">
						<select id="xueke" name="xueke.id" class="form-control m-b required" data-value="${kewenshez.xueke.id}">
							<option value=""></option>
							<c:forEach items="${fns:getSelectList('','','bt_base','name','classid|学科设置' )}" var="dict">
								<option value="${dict.id}">${dict.name}</option>
							</c:forEach>
						</select>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 col-md-1 control-label">年级：</label>
					<div class="col-sm-10 col-md-2">
						<select id="nianji" name="nianji.id" class="form-control m-b required" data-value="${kewenshez.nianji.id}">
							<option value=""></option>
							<c:forEach items="${fns:getSelectList('','','bt_base','name','classid|就读年级' )}" var="dict">
								<option value="${dict.id}">${dict.name}</option>
							</c:forEach>
						</select>
					</div>
					<label class="col-sm-2 col-md-1 control-label">学期：</label>
					<div class="col-sm-10 col-md-2">
						<select id="xueqi" name="xueqi.id" class="form-control m-b required" data-value="${kewenshez.xueqi.id}">
							<option value=""></option>
							<c:forEach items="${fns:getSelectList('','','bt_base','name','classid|学期设置' )}" var="dict">
								<option value="${dict.id}">${dict.name}</option>
							</c:forEach>
						</select>
					</div>
					<label class="col-sm-2 col-md-1 control-label">序号：</label>
					<div class="col-sm-10 col-md-2">
						<form:input path="sort" htmlEscape="false"    class="form-control "/>
					</div>
					<label class="col-sm-2 col-md-1 control-label">备注：</label>
					<div class="col-sm-10 col-md-8">
						<form:input path="remarks" htmlEscape="false"    class="form-control "/>
					</div>
				</div>
			</fieldset>
	</form:form>
</body>
</html>
